home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / amok_lha / amok15.lha / Seafarers_Manual / Source / Main2.mod < prev    next >
Text File  |  1993-08-15  |  741b  |  46 lines

  1. MODULE Main2;   (* Export the entire module *)
  2.  
  3.   (* From the book "Modula-2  A Seafarer's Manual and Shipyard Guide" *)
  4.   (* Page 177   adapted "Amiga M2Modula-2"   13 Mar 1988 *)
  5.  
  6. FROM InOut IMPORT Write,
  7.                   WriteLn;
  8.  
  9.  
  10. MODULE A;
  11.   EXPORT B,C,x;        (* x, B.x, C.x, B.C.x  visible here *)
  12.  
  13.     
  14.   MODULE B;
  15.     EXPORT C,x;        (* x, C.x  visible here *)
  16.     
  17.     
  18.     MODULE C;
  19.       EXPORT x;        (* x  visible here *)
  20.       
  21.       CONST
  22.         x = "!";
  23.         
  24.       END C;
  25.       
  26.     
  27.     END B;
  28.     
  29.  
  30.   END A;
  31.   
  32.   
  33. BEGIN            (* Main *)
  34.   
  35.   Write (x);        (* these all refer to x *)
  36.   Write (A.x);
  37.   Write (B.x);
  38.   Write (C.x);
  39.   Write (A.B.x);
  40.   Write (A.C.x);
  41.   Write (B.C.x);
  42.   Write (A.B.C.x);
  43.   WriteLn; WriteLn;
  44.   
  45. END Main2.
  46.